package com.study.excel.easyexcel;

import com.alibaba.excel.write.handler.CellWriteHandler;
import com.alibaba.excel.write.metadata.holder.WriteSheetHolder;
import com.alibaba.excel.write.metadata.holder.WriteTableHolder;
import org.apache.poi.ss.usermodel.CellStyle;
import org.apache.poi.ss.usermodel.IndexedColors;

import java.util.List;

public class CustomCellWriteHandler implements CellWriteHandler {
   /* @Override
    public void beforeCellCreate(WriteSheetHolder writeSheetHolder, WriteTableHolder writeTableHolder, List<CellWriteHandler> cellWriteHandlerList, Head head, Integer relativeRowIndex, Boolean isHead) {
        // 自定义单元格样式
        if (isHead) {
            CellStyle cellStyle = writeSheetHolder.getSheet().getWorkbook().createCellStyle();
            cellStyle.setFillForegroundColor(IndexedColors.YELLOW.getIndex());
            cellStyle.setFillPattern(CellStyle.SOLID_FOREGROUND);
            writeSheetHolder.getSheet().setDefaultColumnStyle(0, cellStyle);
        }
    }*/



}
